3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next

Utility Functions

QuickDraw 3D provides several mathematical utility functions. You can use the following two macros to convert degrees to radians, and vice versa. These functions use the constant kQ3Pi , equal to .

#define Q3Math_DegreesToRadians(x)              ((x) * kQ3Pi / 180.0)
#define Q3Math_RadiansToDegrees(x)              ((x) * 180.0 / kQ3Pi)

You can use the following two macros to get the minimum and maximum of two values.

#define Q3Math_Min(x,y)             ((x) <= (y) ? (x) : (y))
#define Q3Math_Max(x,y)             ((x) >= (y) ? (x) : (y))

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next